
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

.custom-field-single(class!="<%= type === 'checkbox' ? 'custom-field-checkbox' : '' %>")
    .custom-field-data
        span.custom-field-name
            <%- name %>
        <% if (description){ %>
        span.custom-field-description
            <%- description %>
        <% } %>

    .custom-field-value-container
        <% if (type=="url") { %>
        .custom-field-value.js-value-view-mode
            span
                a(href!="<%- value %>")
                    <%- value %>
        <% } else if (type=="richtext") { %>
        .custom-field-value.wysiwyg
            span(
                ng-bind-html="attributeHtml"
            )
        <% } else if (type=="checkbox") { %>
        .custom-field-value.js-value-view-mode
            <% if (value) { %>
            span {{ 'COMMON.YES' | translate }}
            <% } else { %>
            span {{ 'COMMON.NO' | translate }}
            <% } %>
        <% } else { %>
        .custom-field-value.js-value-view-mode
            span(ng-bind-html="attributeHtml")
        <% } %>

        <% if (isEditable) { %>
        .custom-field-options
            a.js-edit-description(href="", title="{{'COMMON.CUSTOM_ATTRIBUTES.EDIT' | translate}}")
                tg-svg(svg-icon="icon-edit")
        <% } %>
